package com.haixiaoke.saas.order.mapper;

import com.haixiaoke.saas.order.domain.OrderStateRecord;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单状态变更记录Mapper接口
 *
 * @author qixi
 * @date 2024-04-07
 */
public interface OrderStateRecordMapper {
    /**
     * 查询订单状态变更记录
     *
     * @param recordId 订单状态变更记录主键
     * @return 订单状态变更记录
     */
    OrderStateRecord selectOrderStateRecordByRecordId(Long recordId);

    /**
     * 查询订单状态变更记录列表
     *
     * @param orderStateRecord 订单状态变更记录
     * @return 订单状态变更记录集合
     */
    List<OrderStateRecord> selectOrderStateRecordList(OrderStateRecord orderStateRecord);

    /**
     * 新增订单状态变更记录
     *
     * @param orderStateRecord 订单状态变更记录
     * @return 结果
     */
    int insertOrderStateRecord(OrderStateRecord orderStateRecord);

    /**
     * 修改订单状态变更记录
     *
     * @param orderStateRecord 订单状态变更记录
     * @return 结果
     */
    int updateOrderStateRecord(OrderStateRecord orderStateRecord);

    /**
     * 删除订单状态变更记录
     *
     * @param recordId 订单状态变更记录主键
     * @return 结果
     */
    int deleteOrderStateRecordByRecordId(Long recordId);

    /**
     * 批量删除订单状态变更记录
     *
     * @param recordIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteOrderStateRecordByRecordIds(Long[] recordIds);

    /**
     * 根据订单id和状态，查询订单操作记录
     * @param orderId
     * @param orderState
     * @return
     */
    OrderStateRecord selectOrderStateRecordByOrderIdAndState(@Param("orderId") String orderId, @Param("orderState") String orderState);
}
